<template>
  <article class="page">
    <headerbar>培训情况详情
    </headerbar>

    <div class="nav-wrap">
      <cube-scroll-nav-bar :current="current" :labels="labels" @change="changeHandler"/>
    </div>

    <!--请假旷课-->
    <section class="block" v-if="data.leaveList && '请假旷课'==current">
      <div class="pdv-3 list-news-img list-wenda mgh-2">
        <div v-for="(item,index) in data.leaveList" :key="index" class="item">
          <div class="cont  pdh-0">
            <div class="title">{{item.trainingclass}}</div>
            <div class="">
              <p class="tip">课程名称：{{item.curriculumName}}</p>
              <p class="tip">开始时间：{{getTime(item.beginTime)}}</p>
              <p class="tip">结束时间：{{getTime(item.endTime)}}</p>
            </div>
          </div>

        </div>
      </div>
      <noData v-if="data.leaveList.length === 0"></noData>
    </section>
    <!--评价信息-->
    <section class=" pdv-3 " v-if="data.pjList && '评价信息'==current">
      <section class="people-list ">

        <div class="people-item bg-white block" v-for="item in data.userContactList">
          <section class="people-info">
            <span class="name">评价类型：{{item.type==='4'?'培训机构对学员评价':'培训机构对学员评价'}}</span>
            <span class="name">总平均分:{{item.score}}</span>
          </section>
          <span class="">
            </span>
        </div>
      </section>
      <noData v-if="data.pjList.length === 0"></noData>
    </section>
  </article>
</template>

<script>
  import moment from 'moment'

  export default {
    name: 'training',
    data () {
      return {
        data: {},
        current: '评价信息',
        labels: [
          '评价信息',
          '请假旷课'
        ]
      }
    },
    created () {
      this.data = this.$store.state.trainingDetail
    },
    methods: {
      changeHandler (cur) {
        this.current = cur
      },
      getTime (createTime) {
        return moment(createTime).format('YYYY-MM-DD')
      }
    }
  }
</script>

<style scoped>

</style>
